<template>
	<Layout>
        <Header class="header">
					博客管理平台
				</Header>
        <Layout class="content">
            <Sider hide-trigger class="side">
							<sideMain></sideMain>
						</Sider>
            <Content>
							<p>文章列表</p>
							<div class="title"><span>标题</span><span>文章分类</span><span>文章内容</span><span>发表时间</span><span>编辑</span></div>
							<div class="title" v-for="(item,index) in blog" :key="index">
								{{item.id}}
								<home-info :Title="item.title" :Categories="item.categories" :EditorContent="item.editorContent" :Time="item.time" :ListId="item._id"></home-info>
							</div>
						</Content>
        </Layout>
    </Layout>
</template>

<script>
import SideMain from '~/components/Side'
import HomeInfo from '~/components/homeInfo'
import formatDate from '~/static/filter/date.js'
import axios from 'axios'
export default {
	data(){
		return {
			blog:[]
		}
	},
	components:{
		SideMain,
		HomeInfo
	},
	created(){
		axios.post('/admin/home').then((rseponse)=>{
			this.blog = rseponse.data.message
			console.log(this.blog)
		})
	}
}
</script>

<style lang="stylus" scoped>
.header
	font-size 18px
	color #fff
	background-color #20a0ff
.content
	height 600px
	.side
		background-color #ececec
		color #657180
p
	border-bottom 1px solid #ccc
	padding 10px
.title
	line-height 40px
	span 
		float left
		width 20%
		text-align center
		border-right 1px solid #ccc
		border-bottom 1px solid #ccc
		div
			color #222
			text-decoration none
			padding 10px
			margin-left 5px
			background-color skyblue
			display inline
			cursor pointer
		div:nth-child(2)
			background-color red
	span:nth-child(1)
		border-left 1px solid #ccc
</style>

